home *** CD-ROM | disk | FTP | other *** search
/ American History: Interactive Maps & User's Guide / American History: Interactive Maps & User's Guide.iso / pc / ImapTest.dxr / 00002.ls < prev    next >
Encoding:
Text File  |  2000-01-25  |  2.9 KB  |  107 lines

  1. on swapCast spriteNumber, castMember
  2.   set the castNum of sprite spriteNumber to member castMember
  3.   set the visible of sprite spriteNumber to 1
  4.   updateStage()
  5. end
  6.  
  7. on setButtonChosen whichButton
  8.   global TheirAnswer
  9.   if TheirAnswer <> 0 then
  10.     if TheirAnswer = whichButton then
  11.       swapCast(whichButton + 15, "normal button")
  12.       swapCast(30, "DoneNoSparkle")
  13.       set TheirAnswer to 0
  14.     end if
  15.   else
  16.     set TheirAnswer to whichButton
  17.     repeat with buttonNum = 1 to 4
  18.       if buttonNum = TheirAnswer then
  19.         swapCast(buttonNum + 15, "yellow button")
  20.         next repeat
  21.       end if
  22.       swapCast(buttonNum + 15, "normal button")
  23.     end repeat
  24.     swapCast(30, "DoneSparkle")
  25.     updateStage()
  26.   end if
  27. end
  28.  
  29. on setButtonChosenFor2Choices whichButton
  30.   global TheirAnswer1, TheirAnswer2, MultipleChoicesClicked
  31.   if whichButton = TheirAnswer1 then
  32.     swapCast(whichButton + 15, "normal button")
  33.     swapCast(30, "DoneNoSparkle")
  34.     set MultipleChoicesClicked to MultipleChoicesClicked - 1
  35.     set TheirAnswer1 to 0
  36.     exit
  37.   end if
  38.   if whichButton = TheirAnswer2 then
  39.     swapCast(whichButton + 15, "normal button")
  40.     swapCast(30, "DoneNoSparkle")
  41.     set MultipleChoicesClicked to MultipleChoicesClicked - 1
  42.     set TheirAnswer2 to 0
  43.     exit
  44.   end if
  45.   if MultipleChoicesClicked = 2 then
  46.     exit
  47.   end if
  48.   set MultipleChoicesClicked to MultipleChoicesClicked + 1
  49.   case MultipleChoicesClicked of
  50.     1:
  51.       set TheirAnswer1 to whichButton
  52.     2:
  53.       if TheirAnswer2 = 0 then
  54.         set TheirAnswer2 to whichButton
  55.       else
  56.         set TheirAnswer1 to whichButton
  57.       end if
  58.   end case
  59.   swapCast(whichButton + 15, "yellow button")
  60.   updateStage()
  61.   if MultipleChoicesClicked = 2 then
  62.     CreateTwoDigitAnswer(TheirAnswer1, TheirAnswer2)
  63.     swapCast(30, "DoneSparkle")
  64.   end if
  65. end
  66.  
  67. on CreateTwoDigitAnswer TheirAnswer1, TheirAnswer2
  68.   global TheirAnswer
  69.   if TheirAnswer1 > TheirAnswer2 then
  70.     set temp to TheirAnswer2
  71.     set TheirAnswer2 to TheirAnswer1
  72.     set TheirAnswer1 to temp
  73.   end if
  74.   set TheirAnswer to (10 * TheirAnswer1) + TheirAnswer2
  75. end
  76.  
  77. on hCursor vTRUEorFALSE, vWhichCursor, vFirstSprite, vLastSprite
  78.   set lStrCursorMask to vWhichCursor && "mask"
  79.   set gCursor to [the number of member vWhichCursor, the number of member lStrCursorMask]
  80.   if vTRUEorFALSE = 1 then
  81.     if vFirstSprite = vLastSprite then
  82.       set the cursor of sprite vFirstSprite to gCursor
  83.     else
  84.       repeat with n = vFirstSprite to vLastSprite
  85.         set the cursor of sprite n to gCursor
  86.       end repeat
  87.     end if
  88.   else
  89.     if vFirstSprite = vLastSprite then
  90.       set the cursor of sprite vFirstSprite to 0
  91.     else
  92.       repeat with n = vFirstSprite to vLastSprite
  93.         set the cursor of sprite n to 0
  94.       end repeat
  95.     end if
  96.   end if
  97. end
  98.  
  99. on hCheckStatus
  100.   set lStrStatus to the name of member the castNum of sprite 30
  101.   if lStrStatus = "RarrowOnly" then
  102.     return 1
  103.   else
  104.     return 0
  105.   end if
  106. end
  107.